<script>
	$(function(){

			var users = $.parseJSON(<?php echo "'" . $this->users . "'" ?>);

			if(users.length == 0)
			{
				alert("geen gebruikers geselecteerd");
				return;
			}
		
            $('#resetPwModal').modal('show');

    		$("#formResetPassword").ajaxForm({
    			beforeSubmit:  preventDoubleSubmit,
    			data:  {"users[]":users},
    			success: function(responseText, statusText, xhr, $form) { 

    				isSubmitting = false;

    				if(responseText.length > 0)
    				{
    						alert(responseText);
    				}else{
    					$('#resetPwModal').modal('hide');
    				}
    	    }});
	});
</script>

<form
	class="form-horizontal"
	action="<?php echo $this->SE_path . "/users/resetpw" ?>"
	method="post"
	id="formResetPassword">

	<div
		class="hide SEsupermodal"
		id="resetPwModal">
		<div>
			<div class="modal-header">
				<a
					class="close"
					data-dismiss="modal">×</a>
				<h3 id="modaltitle">
					Wachtwoord reset voor
					<?php echo $this->usersCount ?>
					gebruikers
				</h3>
			</div>
			<div
				class="modal-body"
				style="width: 300px;">

				<div class="control-group">
					<label
						class="control-label"
						for="txtPassword">Nieuw wachtwoord:</label>
					<div class="controls">
						<div class="input-append">
							<input
								
								size="16"
								name="AccountPassword"
								class="span2"
								type="password"
								value="">
						</div>
					</div>
				</div>

				<div class="control-group">
					<label
						class="control-label"
						for="txtPassword">Herhaal wachtwoord:</label>
					<div class="controls">
						<div class="input-append">
							<input
								
								size="16"
								name="AccountPasswordRepeat"
								class="span2"
								type="password"
								value="">
						</div>
					</div>
				</div>

				<div class="control-group">
					<label
						class="control-label"
						for="cbActive">Random wachtwoord</label>
					<div class="controls">

						<label class="checkbox">
							<input
								name="random"
								value="true"
								type="checkbox">

						</label>

					</div>
				</div>



			</div>
			<div class="modal-footer">
				<a
					href="#"
					class="btn"
					data-dismiss="modal">Annuleren</a>
				<button
					class="btn btn-primary"
					name="submit"
					value="reset"
					type="submit">Reset</button>
			</div>
		</div>
	</div>

</form>
